home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / viocurso.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  1.4 KB  |  72 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "vio.h"
  12.  
  13. #pragma argsused
  14. //
  15. //    Get cursor info
  16. //
  17. USHORT _APICALL
  18. VioGetCurType ( VIOCURSORINFO far *pcinfo,
  19.                 unsigned short )
  20. {
  21.     _AX = 0x0300 ;
  22.     geninterrupt(0x10) ;
  23.     pcinfo->yStart = _CH ;
  24.     pcinfo->cEnd = _CL ;
  25.     pcinfo->cx = 1 ;
  26.     pcinfo->attr = (0 << 4) + 7 ;
  27.     return NO_ERROR ;
  28. }
  29.  
  30. #pragma argsused
  31. //
  32. //    Set cursor info
  33. //
  34. USHORT _APICALL
  35. VioSetCurType ( VIOCURSORINFO far *pcinfo,
  36.                 unsigned short )
  37. {
  38.     _AX = 0x0100 ;
  39.     _CH = pcinfo->yStart ;
  40.     _CL = pcinfo->cEnd ;
  41.     geninterrupt(0x10) ;
  42.     return NO_ERROR ;
  43. }
  44.  
  45. #pragma argsused
  46. //
  47. //    Get cursor position
  48. //
  49. USHORT _APICALL
  50. VioGetCurPos  ( unsigned short far *RowPtr,
  51.                 unsigned short far *ColPtr,
  52.                 unsigned short VioHandle )
  53. {
  54.     unsigned short pos = VioDosGetCurPos() ;
  55.     *RowPtr = pos >> 8 ;
  56.     *ColPtr = pos & 0xFF ;
  57.     return NO_ERROR ;
  58. }
  59.  
  60. #pragma argsused
  61. //
  62. //    Set cursor position
  63. //
  64. USHORT _APICALL
  65. VioSetCurPos  ( unsigned short Row,
  66.                 unsigned short Col,
  67.                 unsigned short VioHandle )
  68. {
  69.     VioDosSetCurPos ((Row << 8) + (Col & 0xFF)) ;
  70.     return NO_ERROR ;
  71. }
  72.